function funcLabel1()
    local a = 1
    ::testLabel::
    print("label" .. a)
    a = a + 1
    if a < 3 then
        goto testLabel
    end
end

function funcLabel2()
    local a = 1
    ::testLabel::
    print("label" .. a)
    a = a + 1
    if a > 3 then
        os.exit()
    end
    goto testLabel

end


function funcLabel3()
    local arr = {"k1", "v1","k2","v2"}
    for k, v in pairs(arr) do
        print(k.."-"..v)
    end

end

function egg_quest()
    local s = 1;
    for k=1, 8 do
       local p = k*0.02+0.475
       print(p)
       s = s * p
    end
    print(s)
end

function egg_test()
    local s = 0
    local bag = 0;
    local y = 10000
    for k=1, y do
        local egg_count = 1;
        for i=1, 10 do
            local p = egg_count*0.02+0.475
            local r = math.random(1,100)
            if(r<p*100) then
                egg_count=egg_count+1
            end

            if egg_count>=9 then
                s=s+1
                break
            end
            if i==10 and egg_count<=2 then
               bag = bag+1 
            end
        end

    end
    print(s/y*100 .. "%")
    print(bag/y*100 .. "%")
end

function egg_test2()
    local s = 0
    local bag = 0;
    local y = 10000
    for k=1, y do
        local egg_count = 3;
        for i=1, 10 do
            local p = egg_count*0.02+0.475
            local r = math.random(1,100)
            if(r<p*100) then
                egg_count=egg_count+1
            end

            if egg_count>=9 then
                s=s+1
                break
            end
            if i==10 and egg_count<=9 then
               bag = bag+1 
            end
        end

    end
    print(s/y*100 .. "%")
    print(bag/y*100 .. "%")
end

function egg_test3()
    local s = 0
    local bag = 0;
    local y = 10000
    for k=1, y do
        local egg_count = 3;
        for i=4, 10 do
            local p = egg_count*0.02+0.475
            local r = math.random(1,100)
            if(r<p*100) then
                egg_count=egg_count+1
            end

            if egg_count>=9 then
                s=s+1
                break
            end
            if i==10 and egg_count<=9 then
               bag = bag+1 
            end
        end

    end
    print(s/y*100 .. "%")
    print(bag/y*100 .. "%")
end

egg_test3()

